#!/usr/bin/env python
# # -*- coding: utf-8 -*-

from tkinter import *
import sesson2.subject2
import sesson2.subject1
import hashlib
import os
import random
import sys
import os
import ctypes
import time
import time
from threading import Timer
import sesson2
import json
# print("path",os.path.dirname(__file__)+"/sesson2/subject2")
import sesson3.subject1.session3_2_main as sesson2_1
# import sesson3.subject1.session3_2_main as sesson2_1


def CAL2(num):
    if num == 59 or num == 195 or num == 225 or num == 498:
        return
    spath = "D:/session/session_3/subject_1/ai_path_"+str(num)+".json"

    ai_json = "D:/session/session_3/subject_1/" + \
        "ai_path_" + str(num) + ".json"
    cient_json ="D:/session/session_3/subject_1/" + \
        "client_path_" + str(num) + ".json"
    clid = dict()
    with open(cient_json, 'r', encoding='utf-8') as f:
        clientdata = json.load(f)  # 将json文件解析为python数据
        for val in clientdata["place_points"]:
            clid.setdefault(val["place_id"], val["place_type"])
            # print(val["place_id"], val["place_type"])
    with open(ai_json, 'r', encoding='utf-8') as f:
        data = json.load(f)  # 将json文件解析为python数据
        
        for place in data["places"]:
            p_Id = []
            for people in place["people"]:
                p_Id.append(people["people_type"])
                p_Id.sort()
            # print(place["place_id"],len(p_Id),clid[place["place_id"]])

import os
examRound=1
# try:
#     time_start = time.time()
# CAL2(examRound
sesson2_1.view_ai_path(examRound)
# except Exception as e:
#     print(e)
#     ret = -1
#     p1 = -1
#     print('Timeout Error Catched!')
# time_end = time.time()
# print('totally cost', time_end-time_start,"examRound",examRound)